Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add drag-and-drop queue reordering, closes #34 #80

Merged
merged 1 commit into from
Oct 3, 2023

Conversation

14mRh4X0r
Copy link
Contributor

The easiest way to implement this is to harness GtkTreeView's reorderable property. However, this doesn't work with GtkTreeModelFilter, so the TreeView's model gets switched based on whether filtering is active.

To facilitate reordering, I added playlist position as a column, so when the row data gets inserted in the new position, the TreePath (row index) and pos column can be used as move target and source, respectively.

After issuing the move command, the playlist status will change and update the queue with the new positions.

The easiest way to implement this is to harness GtkTreeView's
reorderable property. However, this doesn't work with
GtkTreeModelFilter, so the TreeView's model gets switched based on
whether filtering is active.

To facilitate reordering, I added playlist position as a column, so when
the row data gets inserted in the new position, the TreePath (row index)
and pos column can be used as move target and source, respectively.

After issuing the move command, the playlist status will change and
update the queue with the new positions.
@yktoo
Copy link
Owner

yktoo commented Sep 25, 2023

Hi @14mRh4X0r, thanks for the PR!

It seems to work at first glance, there's one major problem though: it's impossible to drag multiple items. You can select several items, but the selection gets reduced to a single item on mouse down, and that limits the functionality to dragging individual tracks around. Is there any solution to that?

@14mRh4X0r
Copy link
Contributor Author

14mRh4X0r commented Sep 30, 2023

That's due to how GtkTreeView's reorderable is implemented. I tried implementing this feature with proper DnD, but I couldn't find any documentation whatsoever about implementing that in GTK.

@yktoo yktoo merged commit f9d9ab2 into yktoo:dev Oct 3, 2023
@14mRh4X0r 14mRh4X0r deleted the queue-reordering branch October 3, 2023 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants